def calculate_operations(a, b):
    sum_result = a + b
    difference = a - b
    product = a * b
    if b != 0:
        quotient = a / b
    else:
        quotient = "undefined (division by zero)"
    return sum_result, difference, product, quotient

a = float(input("请输入第一个数字a: "))
b = float(input("请输入第二个数字b: "))
results = calculate_operations(a, b)
print(f"和: {results[0]}")
print(f"差: {results[1]}")
print(f"积: {results[2]}")
print(f"商: {results[3]}")